<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateCooperativeUser extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('cooperative_user', function (Blueprint $table) {
            $table->integerIncrements('id');
            $table->unsignedInteger('cooperative_id')->comment('合作商id');
            $table->string('phone', 20)->default('')->comment('账号');
            $table->string('password', 64)->default('')->comment('密码');
            $table->string('username', 30)->default('')->comment('用户名');
            $table->string('contact', 20)->default('')->comment('联系方式');
            $table->string('avatar', 80)->default('')->comment('头像');
            $table->unsignedTinyInteger('is_manager')->default(0)->comment('是否总管理员 1:是 0:否');
            $table->unsignedTinyInteger('status')->default(0)->comment('1:启用，0：未启用');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('cooperative_user');
    }
}
